/**
 * 
 */
package com.lanswon.controller.admin;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.fileupload.disk.DiskFileItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.lanswon.common.enums.MessageType;
import com.lanswon.entity.BusVO;
import com.lanswon.service.BusService;

/**
 * 
 * @ClassName: BusController.java
 * @Description: 该类的功能描述
 *
 * @version: v1.0.0
 * @author: zm
 * @date: 2018年5月30日 下午1:52:38
 *
 */
@Controller
@RequestMapping("admin/bus")
public class AdminBusController {
	@Autowired
	BusService busService;

	@RequestMapping("index")
	public String index() throws IOException {
		return "admin/bus/index";
	}

	@RequestMapping("upload")
	@ResponseBody
	public Map<String, Object> upLoadBus(@RequestParam(value = "file") MultipartFile multipartFile,
			HttpServletRequest request) {
		return busService.upLoadBus(multipartFile);
	}
}
